<?php

namespace app\admin\controller;
use app\BaseController;
use think\App;
use think\exception\HttpResponseException;
use think\facade\View;

class adminBase extends BaseController
{


    public function initialize()
    {

        parent::initialize();
        //判断是否登录切换到中间件中
//        if(empty($this->isLogin())){
//           return $this->redirect(url('login/index'),302);
//        }
    }

    public function isLogin(){
        $adminUser = session(config("admin.session_admin"));
        if(empty($adminUser)){
            return false;
        }
        return true;
    }

    public function redirect(...$args){
        throw new HttpResponseException(redirect(...$args));
    }


}